package com.itheima.chapter08;
//可变参数
public class demo {
    public static void main(String[] args) {
        int sum = sum(10, 20);
        System.out.println(sum);
        System.out.println(sum(10,20,30));
    }
    public static  int sum(int...a){
        int sum =0;
        for (int i : a) {
            sum+=i;
        }
        return sum;
    }
}
